package com.jurassic.demo.designMode.factory;

/**
 * @Author pan_jin
 * @Description: $
 * @Date: 2022/7/13 9:52
 * @Version: 1.0.0
 * @Slogan: 梦想还是要有的万一实现了呢
 */
public interface AbstractDocumentFactory {

    HtmlDocument createHtml(String str);

    WordDocument createWord(String str);

    public static AbstractDocumentFactory create(String name) {
        if (name.equals("fast")) {
            return new FastFactory();
        } else if (name.equals("google")) {
            return new GoogleFactory();
        } else {
            throw new IllegalArgumentException();
        }
    }
}
